package com.suep.business.service.impl;

import com.suep.business.domain.OrderItem;
import com.suep.business.mapper.OrderItemMapper;
import com.suep.business.service.IOrderItemService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class OrderItemServiceImpl implements IOrderItemService {

    @Autowired
    private OrderItemMapper orderItemMapper;

    @Override
    public Integer insertOrderItem(OrderItem orderItem) {
        return orderItemMapper.insertOrderItem(orderItem);
    }

    @Override
    public OrderItem selectOrderItemById(Integer orderItemId) {
        return orderItemMapper.selectOrderItemById(orderItemId);
    }

    @Override
    public List<OrderItem> selectOrderItemsByOrderId(Long orderId) {
        return orderItemMapper.selectOrderItemByOrderId(orderId);
    }

    @Override
    public List<OrderItem> selectOrderItemsByMealId(Integer mealId) {
        return orderItemMapper.selectOrderItemByMealId(mealId);
    }

    @Override
    public Integer updateOrderItem(OrderItem orderItem) {
        return orderItemMapper.updateOrderItemById(orderItem);
    }

    @Override
    public Integer deleteOrderItemById(Integer orderItemId) {
        return orderItemMapper.deleteOrderItemById(orderItemId);
    }
}
